<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateOrganizationTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('mckj_organization', function (Blueprint $table) {
            $table->increments('id');
            $table->integer('org_uid')->index()->default(0)->comment('机构所属用户ID');
            $table->integer('org_type_id')->comment('机构所属类型ID');
            $table->string('name')->comment('机构名称');
            $table->integer('province_code')->comment('省行政区划代码');
            $table->integer('city_code')->comment('市行政区划代码');
            $table->integer('district_code')->comment('区行政区划代码');
            $table->string('address')->comment('详细地址');
            $table->string('company_tel')->comment('公司电话');
            $table->timestamp('created_time')->nullable();
            $table->timestamp('updated_time')->nullable();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('mckj_organization');
    }
}
